package com.order.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author zw
 * @date 2022-08-20.
 */
@Configuration
public class OrderConfig {
    /**
     * 负责注入到spring容器中
     * @return 注入的对象
     */
    @Bean
    @LoadBalanced //使用负载均衡功能
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }
}